import request from '@/utils/request'
const api_name = '/admin/hosp/hospitalSet'

export default {
  getHospSetList(current, limit, searchObj) {
    return request({
      url: `${api_name}/findPageHospSet/${current}/${limit}`,
      method: 'post',
      data: searchObj  // 使用json数据
    })
  },
  list() {
    return request({
      url: `${api_name}`,
      method: 'get'
    })
  },
  removeHospSet(idList) {
    return request({
      url: `${api_name}/batchRemove`,
      method: 'delete',
      data: idList
    })
  },
  removeHospSetId(id) {
    return request({
      url: `${api_name}/${id}`,
      method: 'delete'
    })
  },
  //锁定和取消锁定
  lockHospSet(id, status) {
    return request({
      url: `${api_name}/lockHospitalSet/${id}/${status}`,
      method: 'put'
    })
  },
  //添加医院设置
  saveHospSet(hospitalSet) {
    return request({
      url: `${api_name}/saveHospitalSet`,
      method: 'post',
      data: hospitalSet
    })
  },
  //院设置id查询
  getHospSet(id) {
    return request ({
      url: `${api_name}/getHospSet/${id}`,
      method: 'get'
    })
  },
  //添加医院设置
  updateHospSet(hospitalSet) {
    return request({
      url: `${api_name}/updateHospitalSet`,
      method: 'put',
      data: hospitalSet
    })
  }
}
